// 历史考勤
import httpAPI from '../../utils/http.js'

export default {
  /**
   * 查询每天考勤
   * @param {Object} projectId 项目id
   * @param {Object} params 参数
   */
  getAttendance (projectId, params) {
    return httpAPI.get(`system/attendance/as/${projectId}/day`, params)
  },
  /**
   * 查询每月到岗天数
   * @param {Object} projectId 项目id
   */
  getAttendanceByMonth(projectId, date) {
    return httpAPI.get(`system/attendance/as/${projectId}/month`, date)
  },
  /**
   * 考勤统计
   * @param {Object} projectId 项目id
   */
  getAttendanceStatistical(projectId, date) {
    return httpAPI.get(`system/attendance/as/${projectId}/today`, {
      date
    })
  },
  /**
   * 查询工种出勤信息
   * @param {Object} projectId 项目id
   * @param {Object} date 日期
   */
  getAttendanceListByWorkType(projectId, date) {
    return httpAPI.get(`system/attendance/as/${projectId}/workType`, {
      date
    })
  },
  /**
   * 查询班组考勤信息
   * @param {Object} projectId 项目id
   * @param {Object} date  日期
   * @param {Object} team 部门班组信息
   */
  getAttendanceListByClass(projectId, date, team, workType) {
    return httpAPI.get(`system/attendance/as/${projectId}/workHour`, {
      date,
      team,
      workType 
    })
  },
  /**
   * 查询部门/班组树形图列表
   */
  getWorkTypeClassList() {
    return httpAPI.get('/system/workbench/teamDeptTree')
  }
}
